<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02_DOM入门</title>
</head>
<body>
<button onclick="addMoney()">点我</button>
<hr>
<script>
    function addMoney() {
        let imgE = document.createElement('img');//<img>
        imgE.src = 'img/money.jpg';//<img src="img/money.jpg">
        imgE.width = 200;//<img src="img/money.jpg" width="200">
        let bodyE = document.querySelector('body');//获取body元素
        bodyE.append(imgE);//将imgE追加到body中
    }
</script>
</body>
</html>